{extend name="layout" /}
{block name="content"}
<div class="mui-content">
	<div class="uk-margin-small-top">
		<form method="post" id="formid">
		{volist name=":get_model_func('MemberAddress', 'list_data', ['userid'=>$_userid])" id="v"}
		<div class="addres-card-radio tm-df-size">
			<div class="main-content">
				<div class="tm-label">
					<div class="tm-flex-row">
						<div class="tm-flex">
							<div class="tm-flex-1">
								<span>收货人：{$v.consignee}</span>
							</div>
							<div>
								<span>{$v.phone}</span>
							</div>
						</div>
					</div>
					<div class="tm-flex-row">
						<div class="tm-label-no">
							<div class="tm-inline-1-3">
								收货地址：{$v.city} {$v.address}
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="mui-radio mui-left">
				<input type="radio" name="addressid" {eq name="key" value="0"} checked {/eq} value="{$v.id}" />
			</div>
		</div>
		{/volist}
		<input type="hidden" name="convertid" value="{$goods_id}">
		</form>
		<div class="uk-margin-large-top">
			<div class="main-content">
				<button type="button" class="mui-btn mui-btn-green mui-btn-block cocoPostFormAjax" ajaxurl="{:url('v2/order/exchange')}" formid="formid" ajax-callback="suc_back">确定</button>
			</div>
		</div>	
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	function suc_back(obj, data) {
		location.href = "{$app_url}/index/member/exchange_suc.html?token="+token+"&timestamp="+{:time()};
	}
</script>
<script type="text/javascript">
    $(function(){
        c3_navtive_user.right_button_item1 = {
            title:"添加",
            callback:function(){
                var content = new Array();
                content['url'] = "{$app_url}/index/member/add_address";
                content['target'] = "blank";
                c3_navtive_user.doActionAnsy('gotopage',content,function(){});
            }
        };
        var button_item = [
            {
                title: "添加",
                returnTag:'1'
            }
        ];
        {if !isset($isphone)}
            c3_navtive_user.doActionFunc("configMenu",button_item,function(datas){
                returntag = eval('(' + datas + ')');
                if(returntag.returnTag == 1){
                    var content = new Array();
	                content['url'] = "{$app_url}/index/member/add_address";
	                content['target'] = "blank";
	                c3_navtive_user.doActionAnsy('gotopage',content,function(){});
                }
                else if(returntag.returnTag == 2){
                    c3_navtive_user.doActionAnsy('openSearch',null,function(){});
                }
            });
        {/if}
    })
</script>
{/block}